/*
 * agent.h
 *
 *  Created on: 2011-7-23
 *      Author: fufan
 */

#ifndef AGENT_H_
#define AGENT_H_

#include <QDialog>
#include <QMenu>
#include <QSettings>
#include <QPushButton>
#include <QListWidgetItem>
#include <QComboBox>
#include "ui_Agent.h"

class Agent : public QDialog, public Ui::Agent
{
		Q_OBJECT
public:
		Agent(const QString &name, QComboBox *agentBox, QWidget *parent=0);

private:
		void readFromSetting(const QString &agentName);
		void clearDialog();
		void saveGroup(const QString &group);
		void setGroup(const QString &group);

private slots:
		void createItemMenu(const QPoint &pos);
		void showGetBulk(bool checked);
		void saveToSettings();
		void addAgent();
		void deleteAgent();
		void saveAgent();
		void displaySetting(QListWidgetItem *item);
		void nameChange();


private:
		QSettings qSettings;
		QComboBox *agentBox;
};

#endif /* AGENT_H_ */
